<?php
namespace app\index\controller;

use think\Request;
use think\Db;

use app\index\model\answer as AnswerModel;

class Answer {
    public function getBorderId($page, $dataNum, $keyName, $keyWord)
    {
        $table = "dcw_fastask_answer_view";
        $borderId = 0;
        $limit = ($page - 1) * $dataNum;
        if ($limit == 0) {
            $sql = $keyName == "" ?
                    "SELECT * FROM $table ORDER BY id DESC LIMIT 1" :
                    "SELECT * FROM $table WHERE $keyName='$keyWord' ORDER BY id DESC LIMIT 1";
            $res = Db::query($sql);
            $borderId = $res == NULL ? 0 : $res[0]["id"];
        }
        else {

        }
    }
    public function getAnswer(Request $request)
    {
        //获取请求参数
        $page = $request->param("page");
        $dataNum = $request->param("dataNum");
        $keyName = $request->param("keyName");
        $keyWord = $request->param("keyWord");

        if ($keyName == '') {

        }
        else {

        }
    }
}